package com.wwlwxg.algorithm.list;


public class SingleLinkedList {

	public static void main(String[] args) {

		SingleLinkedList list = new SingleLinkedList();
		list.add(new HeroNode(1,"2","3"));
		list.add(new HeroNode(1,"2","3"));
		list.add(new HeroNode(1,"2","3"));
		System.out.println();
	}

	private HeroNode head = new HeroNode();

	public boolean add(HeroNode node) {
		HeroNode temp = head;
		while (true) {
			if(temp.next == null) {
				break;
			}
			temp = temp.next;
		}
		temp.next = node;
		return true;
	}

	public void list() {
	}

	static class HeroNode {
		public int no;
		public String name;
		public String nickname;
		public HeroNode next;
		public HeroNode() {}
		public HeroNode(int no, String name, String nickname) {
			this.no = no;
			this.name = name;
			this.nickname = nickname;
		}

		@Override
		public String toString() {
			return "HeroNode{" +
					"no=" + no +
					", name='" + name + '\'' +
					", nickname='" + nickname + '\'' +
					", next=" + next +
					'}';
		}
	}
}
